package com.share.encrypt.main;

import com.share.common.service.BaseService;
import com.share.encrypt.main.config.EncryptDatabasesConfiguration;
import com.share.jdbc.repository.UserRepositoryImpl;
import com.share.jdbc.service.UserServiceImpl;

import javax.sql.DataSource;
import java.sql.SQLException;

/**
 * @desc:
 * @author:caifan
 * @date:2020/11/29
 */
public class JavaRawEncryptMain {

    public static void main(final String[] args) throws SQLException {
        DataSource dataSource = new EncryptDatabasesConfiguration().getDataSource();
        BaseService baseService = getExampleService(dataSource);
        baseService.initEnvironment();
        baseService.processSuccess();
    }

    private static BaseService getExampleService(final DataSource dataSource) {
        return new UserServiceImpl(new UserRepositoryImpl(dataSource));
    }
}
